﻿
using Admin.NET.Core;
namespace Admin.NET.Plugin.ApprovalFlow;

/// <summary>
/// 审批记录表
/// </summary>
[SugarTable("approval_record","审批记录表")]
[SysTable]
public class ApprovalRecord  : EntityTenant
{
        
    /// <summary>
    /// 表单ID 属于那个表单的流程
    /// </summary>
    [Required]
    [SugarColumn(ColumnName = "Flow_id", ColumnDescription = "表单ID 属于那个表单的流程", Length = 50)]
    public string Flow_id { get; set; }
    
    /// <summary>
    /// 审批人or 转交人 userId
    /// </summary>
    [Required]
    [SugarColumn(ColumnName = "approver_user_id", ColumnDescription = "审批人or 转交人 userId", Length = 50)]
    public string approver_user_id { get; set; }
    
    /// <summary>
    /// 审批时间
    /// </summary>
    [Required]
    [SugarColumn(ColumnName = "approver_time", ColumnDescription = "审批时间")]
    public DateTime approver_time { get; set; }
    
    /// <summary>
    /// 审批意见
    /// </summary>
    [SugarColumn(ColumnName = "approver_opinions", ColumnDescription = "审批意见", Length = 255)]
    public string? approver_opinions { get; set; }
    
    /// <summary>
    /// 审批结果[1:同意；2:拒绝：3:转交]
    /// </summary>
    [Required]
    [SugarColumn(ColumnName = "approver_result", ColumnDescription = "审批结果[1:同意；2:拒绝：3:转交]")]
    public bool approver_result { get; set; }
    
    /// <summary>
    /// 被转交人userId；approver_result=3时必填
    /// </summary>
    [SugarColumn(ColumnName = "transferee", ColumnDescription = "被转交人userId；approver_result=3时必填", Length = 50)]
    public string? transferee { get; set; }
    
    /// <summary>
    /// 转交备注(此字段暂时无用)
    /// </summary>
    [SugarColumn(ColumnName = "transferee_text", ColumnDescription = "转交备注(此字段暂时无用)", Length = 255)]
    public string? transferee_text { get; set; }
    
    /// <summary>
    /// 附件数组
    /// </summary>
    [SugarColumn(ColumnName = "accessory_url", ColumnDescription = "附件数组", Length = 255)]
    public string? accessory_url { get; set; }
    
    /// <summary>
    /// 属于个节点的审批记录
    /// </summary>
    [Required]
    [SugarColumn(ColumnName = "approver_node", ColumnDescription = "属于个节点的审批记录")]
    public bool approver_node { get; set; }
    
    /// <summary>
    /// 审批次数默认1; 例：当节点B是会签,且有人同意,有人拒绝，当拒绝后会返回上一个节点A。当再次进入节点B时，用来区分,此审批记录是第一次记录还是第二次审批记录或者第N次
    /// </summary>
    [SugarColumn(ColumnName = "approver_count", ColumnDescription = "审批次数默认1; 例：当节点B是会签,且有人同意,有人拒绝，当拒绝后会返回上一个节点A。当再次进入节点B时，用来区分,此审批记录是第一次记录还是第二次审批记录或者第N次")]
    public bool? approver_count { get; set; }
    
}
